System.register([ "./application.js" ], function() {
    "use strict";
    function u(n) {
        return new Promise(function(t, i) {
            function f(t) {
                t.filename === n && (u = t.error);
            }
            var u, r;
            window.addEventListener("error", f);
            r = document.createElement("script");
            r.charset = "utf-8";
            r.async = !0;
            r.crossOrigin = "anonymous";
            r.addEventListener("error", function() {
                window.removeEventListener("error", f);
                i(Error("Error loading " + n));
            });
            r.addEventListener("load", function() {
                window.removeEventListener("error", f);
                document.head.removeChild(r);
                u ? i(u) :t();
            });
            r.src = n;
            document.head.appendChild(r);
        });
    }
    function f(n) {
        for (var i = window.atob(n), r = i.length, u = new Uint8Array(r), t = 0; t < r; t++) u[t] = i.charCodeAt(t);
        return u.buffer;
    }
    function e(n) {
        var t = n.lastIndexOf("/", n.lastIndexOf("/") - 1), i = n.substring(t + 1);
        return f(window.resMap[i]);
    }
    function o() {
        var i;
        n && n.tagName === "CANVAS" || console.error("unknown canvas id:", el);
        var r = n.width, u = n.height, t = document.createElement("div");
        return n && n.parentNode && n.parentNode.insertBefore(t, n), t.setAttribute("id", "Cocos3dGameContainer"), 
        t.appendChild(n), i = t.parentNode === document.body ? document.documentElement :t.parentNode, 
        s(n, "gameCanvas"), n.setAttribute("width", r || "480"), n.setAttribute("height", u || "320"), 
        n.setAttribute("tabindex", "99"), {
            frame:i,
            canvas:n,
            container:t
        };
    }
    function s(n, t) {
        var i = (" " + n.className + " ").indexOf(" " + t + " ") > -1;
        i || (n.className && (n.className += " "), n.className += t);
    }
    var i, n, r, t;
    return {
        setters:[ function(n) {
            i = n.createApplication;
        } ],
        execute:function() {
            n = document.getElementById("GameCanvas");
            r = n.parentElement;
            t = r.getBoundingClientRect();
            n.width = t.width;
            n.height = t.height;
            i({
                loadJsListFile:u,
                fetchWasm:e
            }).then(function(n) {
                return n.start({
                    findCanvas:o
                });
            })["catch"](function(n) {
                console.error(n);
            });
        }
    };
});